<?php

namespace App\Http\Controllers\Admin;
use App\Models\SmsSign;
use Illuminate\Database\Eloquent\Model;

class SmsSignController extends CurdController
{
    protected string $classModel = SmsSign::class;

    public function updateAfter(Model $data)
    {
        $others = SmsSign::where('id', '<>', $data->id)->get();
        foreach ($others as $other) {
            $other->sources = array_values(array_diff($other->sources, $data->sources));
            $other->save();
        }
    }
}
